<?php
class DigDeveloper_ToolController extends Zend_Controller_Action
{
    public function init() {
        DigUi_Service_Template::useAdminTemplate();
    }
    public function indexAction() {
        
    }

    public function createModuleAction() {
        $module = $this->getRequest()->getParam('new_module', null);
        $result = DigDeveloper_Service_Tool::createModule($module);
        if($result) {
            $this->_helper->json(true);
        } else {
            $this->_helper->json(false);
        }
    }

    public function contentTypeAction() {
        $mod = $this->getRequest()->getParam('mod', null);
        $props = $this->getRequest()->getParam('props', null);
        $name = $this->getRequest()->getParam('name', null);
        $this->view->results = DigDeveloper_Service_Tool::createItem($name, $mod, $props);
        return $this->_forward('index');
    }
}
?>
